package com.my.cd.factory.methodFactory;

import com.my.cd.factory.pizza.NYCheesePizza;
import com.my.cd.factory.pizza.NYPepperPizza;
import com.my.cd.factory.pizza.Pizza;

/**
 * 工厂方法实现类：纽约披萨订单
 */
public class NYOrderPizza extends OrderPizza {

    @Override
    Pizza createPizza(String orderType) {
        Pizza pizza = null;
        if (orderType.equals("cheese")) {
            pizza = new NYCheesePizza();
        } else if (orderType.equals("pepper")) {
            pizza = new NYPepperPizza();
        }
        return pizza;
    }

}
